Display formatted text (width=50) as outputΒΆ
textwrap.fill(S, width)
Display formatted text (width=50) as output.
import textwrap
S = '''
Python is a widely used high-level, general-purpose, interpreted,
dynamic programming language. Its design philosophy emphasizes
code readability, and its syntax allows programmers to express
concepts in fewer lines of code than possible in languages such
as C++ or Java.
'''
print(textwrap.fill(S, width=50))
Output:
Python is a widely used high-level, general-
purpose, interpreted, dynamic programming
language. Its design philosophy emphasizes code
readability, and its syntax allows programmers to
express concepts in fewer lines of code than
possible in languages such as C++ or Java.